#include <vector>
#include "generaldef.h"

using namespace std;

#ifndef PROBLEM_H
#define PROBLEM_H 1

class problem_container;
class case_container;

class case_container{
	private:
		char _infile[PATH_LEN];
		char _outfile[PATH_LEN];
		int _timelimit, _memlimit, _fullscore;
		char _casecode[CASECODE_LEN];
	public:
		friend class dataconf_t;
		const char* infile(){ return _infile; }
		const char* outfile(){ return _outfile; }
		int timelimit(){ return _timelimit; }
		int memlimit(){ return _memlimit; }
		int fullscore(){ return _fullscore; }
		void clear(){
			memset(_infile,0,sizeof(_infile));
			memset(_outfile,0,sizeof(_outfile));
			memset(_casecode,0,sizeof(_casecode));
			_timelimit=_memlimit=_fullscore=0;
		}
};

class problem_container{
	private:
		char _title[GENERAL_LEN];
		char _infile[PATH_LEN];
		char _outfile[PATH_LEN];
		char _ignsettings[GENERAL_LEN];
		bool _checkermode;
		char _checker[PATH_LEN];
		vector<case_container> _cases;
	public:
		/* XXX: testing module will be put here. */
		problem_container(){ clear(); }
		friend class dataconf_t;
		const char* title(){ return _title; }
		const char* infile(){ return _infile; }
		const char* outfile(){ return _outfile; }
		const char* ignsettings(){ return _ignsettings; }
		bool ifchecker(){ return _checkermode; }
		const char* checker(){ return _checker; }
		int casecnt(){ return _cases.size(); }
		void clear(){
			memset(_title,0,sizeof(_title));
			memset(_infile,0,sizeof(_infile));
			memset(_outfile,0,sizeof(_outfile));
			memset(_ignsettings,0,sizeof(_ignsettings));
			_checkermode=false;
			memset(_checker,0,sizeof(_checker));
			_cases.clear();
		}
};

#endif
